import requests
import json
from Read_conifg import ReadConfig
from Select_By_Mysql import get_mysql_data

def Pay_Order(Order_Num):
    amout = get_mysql_data(ReadConfig().get_db_info("DB"),
                           "select pay_amount from med_order where order_no='" + Order_Num + "'")
    Pay_Url = ReadConfig().get_http("url_ysd") + "pay/docking/test"
    body="amount=" + amout + "&orderNo=" + Order_Num + "_00"
    requests.get(url=Pay_Url,params=body)
    status=get_mysql_data(ReadConfig().get_db_info("DB"),
                          "select status from med_order where order_no='" + Order_Num + "'")
    if status=="已支付":
        return "成功"
    else:
        return status